import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)

/* Layout */
import Layout from '@/layout'

export const constantRoutes = [
  {
    path: '/',
    component: Layout,
    redirect: '/dashboard',
    children: [{
      path: 'dashboard',
      name: 'Dashboard',
      component: () => import('@/views/dashboard/index'),
      meta: { title: 'Dashboard', icon: 'dashboard', keepAlive: true }
    }]
  },
  {
    path: '/article',
    component: Layout,
    redirect: '/article/view',
    children: [{
      path: 'view',
      name: 'articleView',
      component: () => import('@/views/article/index'),
      meta: { title: '文章标题', icon: 'dashboard' }
    }]
  }
]

const createRouter = () => new Router({
  routes: constantRoutes
})

const router = createRouter()


export default router
